<?php
/**
 * @package scuttle
 * @file /class/AbstractIndexAction.class.php
 **/

if (!defined('XOOPS_ROOT_PATH')) exit;

class Scuttle_AbstractIndexAction extends Scuttle_Action
{
	var $mObject = null;
	var $mObjectHandler = null;

	function _getId()
	{
	}

	function &_getHandler()
	{
	}

	function _setupObject()
	{
		$id = $this->_getId();

		$this->mObjectHandler =& $this->_getHandler();

		$this->mObject =& $this->mObjectHandler->get($id);
	}

	function prepare(&$controller, &$xoopsUser, &$moduleConfig)
	{
		$this->_setupObject();
	}

	function getDefaultView(&$controller, &$xoopsUser)
	{
		if ($this->mObject == null) {
			return SC_FRAME_VIEW_ERROR;
		}

		return SC_VIEW_SUCCESS;
	}

	function execute(&$controller, &$xoopsUser)
	{
		return $this->getDefaultView($controller, $xoopsUser);
	}
}

?>